﻿using System;
using System.Diagnostics.Contracts;

namespace Postnuclear
  {
  /// <summary>
  /// The event arguments for the events which requires to pass some meaningful value.
  /// </summary>
  /// <typeparam name="TValue">The type of the value.</typeparam>
  public sealed class ValueEventArgs<TValue>
    : EventArgs
    {
    #region Public

    // Constructor

    /// <summary>
    /// Initializes a new instance of the <see cref="ValueEventArgs{TValue}"/> class.
    /// </summary>
    /// <param name="value">The value.</param>
    public ValueEventArgs(TValue value)
      {
      Contract.Ensures(object.Equals(Value, value));

      Value = value;
      }

    // Fields

    /// <summary>
    /// Event value.
    /// </summary>
    public readonly TValue Value;

    #endregion
    }
  }